//
//  HYFileDownloadItemViewModel.h
//  XPlayer
//
//  Created by liguoqing on 2023/10/12.
//

#import "BaseViewModel.h"
#import "HYFileDownloadModel.h"
#import "HYFileDownloadTask.h"
#import "HYFileDownloadViewModel.h"
NS_ASSUME_NONNULL_BEGIN

@interface HYFileDownloadItemViewModel : BaseViewModel

// 文件名称
@property (nonatomic, strong) NSString *fileName;
// 文件地址
@property (nonatomic, strong) NSString *fileUrl;
// 文件大小
@property (nonatomic, strong) NSString *fileSize;
// 文件类型：0视频 1音频
@property (nonatomic, assign) NSInteger fileType;
// 视频封面
@property (nonatomic, strong) NSString *imageName;
// 下载进度
@property (nonatomic, assign) CGFloat progress;
// 下载状态
@property (nonatomic, assign) NSInteger downloadStatus;
// 文件日期
@property (nonatomic, strong) NSString *createDate;
// 文件下载时间
@property (nonatomic, strong) NSString *downloadDate;
// 文件夹标识
@property (nonatomic, strong) NSString *folderIdentification;
// 是否私密
@property (nonatomic, assign) BOOL isPrivate;

- (instancetype)initWithDownloadModel:(HYFileDownloadModel *)downloadModel;

@property (nonatomic, strong) RACSubject *filedownCompletdSubject;
/// 下载任务
@property (nonatomic, strong, readonly) HYFileDownloadTask *downloadTask;

/// 开始下载
- (void)startOrPauseDownload;

/// 删除下载
- (BOOL)deleteDownload;

/// 下载完成
- (void)downloadComplete:(NSString *)totalBytes;

/// 保存下载进度
- (void)saveCurrentDownloadProgress:(CGFloat)progress downloadSize:(NSString *)downloadSize;

/// 获取下载地址
- (NSString *)fetchDownloadUrl;

@end

NS_ASSUME_NONNULL_END
